home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
bbs
/
jdrexa10.zip
/
INST4OF4.DAT
/
BBS
/
CONVERT.ZIP
/
CONVERT.BAS
next >
Wrap
BASIC Source File
|
1980-01-01
|
39KB
|
970 lines
'
' Program to convert User and Messages from other BBS programs into the
' JDR_BBS format.
'
' If your BBS brand is not here, upload a copy of your user and message files
' to John and he will expand this to support that BBS format. Call back the
' next day to get a revised copy of this program.
'
'This file was especially designed to be self-contained. Not only should it
'compile with most Basic's, but it should be easily modifiable and portable.
'
' Not converted: toggles/settings (ansi/width/protocol/etc.)
' (users) attribute flags (deleted/etc.)
' high msg ptr's (last message read)
' time/dates (last on/etc.)
' time usage (used today, avail today, etc.)
' msg/conference/file area information
' hack attempts
' temporary stuff (DL's today/etc.)
' address or zip code fields (only city & state)
' note fields like sysop note, computer type
'
' Not converted: time/date fields
' (messages) attribute fields
' cost field
'
' If any of these non-conversions are a problem, let me know and I'll
' fix it.
DEFINT A-Z
'
'
' Create the data structures.
'
'
' UserRecord is the record structure of the USERS file.
'
TYPE UserRecord 'Len = 384
UserName AS STRING * 30 'Mixed case.
Password AS STRING * 15 'Uppercase only.
CityState AS STRING * 30 'Mixed case
SysopNote AS LONG
UserNote AS LONG
BirthDate AS INTEGER 'Birthdate of user.
'Date stored in integer form.
SecLevel AS INTEGER '-32,767 to 32,767 security level.
FirstCall AS INTEGER 'First date user called.
'Date stored in integer form.
Attr AS INTEGER '16 bits: see useredit.ans
Toggles AS INTEGER '16 bits:
'1 True if should beep after transfers.
'2 True if show Enter Msg line numbers.
'3 True if show Read Msg total lines.
'4 True if should "turbo" out the msgs.
'5 True if user is a male.
'6 True if password assist is on.
'7 True if want to see L&D/Point values.
'rest are used. this needs updating.
Protocol AS STRING * 1 'User's procotol default.
Votes AS STRING * 100 '=100 Voting questions (Byte answers).
SubsStart AS INTEGER 'Subscription start date.
'Date stored in integer form.
Style AS STRING * 3
ElapsedMinsC AS INTEGER
ElapsedMins AS INTEGER 'elapsed non-DL/UL mins of calls today.
LastCallerNum AS LONG
LastDateOn AS INTEGER 'Last time user called.
'Date stored in integer form.
PswdChange AS STRING * 1 'Counter towards user change password order.
'0 = off, 1 to 255 ascii value.
AlterDate AS INTEGER 'The last date in which they exercised
'their Life & Death options.
'Date stored in integer form.
Toggles2 AS INTEGER '16 bits:
PRStuff AS STRING * 8 'Peer Review information.
Connect AS STRING * 1 'Last baud user connected at.
NewFilesPtr AS LONG '0 to 2,100,000,000
'What the "NewFilesPtr" number was at the last
'time they called, any stuff with
'numbers higher is new to them.
HighestPtr AS LONG '0 to 2,100,000,000 Highest HileFilePtr they
'know about. NewFilesPtr is call
'dependant--it's updated after they log out,
'this isn't--this is a security measure.
PagedSysop AS INTEGER '0 to 32,767 Number of times they've tried to
'page the sysop.
Logons AS INTEGER '0 to 32,767 Number of logons.
Attempts AS STRING * 1 '0 to 255 Number of bad password attempts
'since their last call.
MinCredits AS INTEGER '-32,767 to 32,767
'Number of minutes to add to their daily
'that their security level gets.
MinMegs AS INTEGER '-32,767 to 32,767
'This number is multiplied by 1 megabyte
'and then added to their "number of
'bytes can download" to determine what
'their download bytes limit is.
MsgsPosted AS INTEGER '0 to 32,767 Total number of public messages
'(excluding NetMail) they've posted.
EMsgsPosted AS INTEGER '0 to 32,767 Total number of private
'(excluding feedback and NetMail) messages
'they've posted.
FMsgsPosted AS INTEGER '0 to 32,767 Total number of feedback
'messages they've posted.
NetMailSent AS INTEGER '0 to 32,767 Total number of NetMail letters
'they've sent.
NetMailRcvd AS INTEGER '0 to 32,767 Total number of NetMail letters
'they've received.
Elapsed AS INTEGER '0 to 32,767 Length of previous call(s).
'Never exceeds maximum daily limit for
'whatever security level.
'Download minutes.
Dnlds AS INTEGER '0 to 32,767 Total files downloaded.
DLBytes AS LONG '0 to 2,100,000,000 Total bytes downloaded.
MinsDLing AS LONG '0 to 2,100,000,000 Total number of minutes
'downloading.
BadDLs AS INTEGER '0 to 32,767 Total number of bad DL's.
Uplds AS INTEGER '0 to 32,767 Total files uploaded.
ULBytes AS LONG '-'ve to 2,100,000,000 Total bytes uploaded.
MinsULing AS LONG '0 to 2,100,000,000 Total number of minutes
'uploading.
BadULs AS INTEGER '0 to 32,767 Total number of bad UL's.
Doors AS INTEGER '0 to 32,767 Number of accesses to doors.
SubsEnd AS INTEGER 'Date subscription ends.
HighNotePtr AS LONG
TotalMonies AS LONG 'total money they've sent.
LastMonies AS LONG 'last amount they sent
Attr2 AS INTEGER
BytesUToday AS LONG 'use date of last call to determine if current
'call means to zero this field.
BytesUWeek AS LONG 'this will have to be a weekly event.
'problem if user on another node when this
'executes.
MsgsRcvd AS INTEGER 'Number of normal messages TO: and read.
EMsgsRcvd AS INTEGER 'Number of private messages TO: and read.
SLSubsEnds AS INTEGER
ScreenSize AS STRING * 1
MsgRC AS STRING * 10 'ansi code for reading messages.
Language AS STRING * 1
RealName AS STRING * 30 'mixed case
HomePhone AS STRING * 17
BBSPhone AS STRING * 17
END TYPE
'
' FeatherNet user record.
'
TYPE FeNUserRecord 'Len = 400
RealName AS STRING * 25 'First & Last Name
CityState AS STRING * 24 'City & State
Password AS STRING * 12 'Password
BBSPhone AS STRING * 13 'Business/Data Phone Number
HomePhone AS STRING * 13 'Voice/Home Phone Number
LastDateOn AS STRING * 6 'Last Date on in (yymmdd) format
LastTImeOn AS STRING * 5 'Last Logon Time in (hh:mm) format
Expert AS STRING * 1 'Expert Mode (y or n)
Protocol AS STRING * 1 'Protocol Type
Future1 AS STRING * 1 '(- Reserved for future use- )
LastDirDate AS STRING * 6 'Last DIR look date (yymmdd) format
SecLevel AS STRING * 1 'Sec Lev
Logons AS INTEGER 'Number of times on System
ScreenSize AS STRING * 1 'Page Length
Uplds AS INTEGER 'Number of Uploads
Dnlds AS INTEGER 'Number of Downloads
DLdBToday AS STRING * 8 'Daily Download Bytes so Far
UserName AS STRING * 25 'Alias Name
MsgsPosted1 AS INTEGER 'Messages left in long integer format.
MsgsPosted2 AS INTEGER
SysopNote AS STRING * 29 'Sysop Maintained Comment
Attr AS STRING * 1
Elapsed AS INTEGER 'Elapsed Time on System for that Day
SubsStart AS STRING * 6 'Subscription Registration Date (yymmdd)
SubsEndSL AS STRING * 1 'Subscription Expired Sec Lev
LastConf AS STRING * 1 'Conference the user last joined
BitMaps AS STRING * 15
DLBytes AS LONG 'Total Bytes Downloaded - all calls
DLBytes2 AS LONG 'Total Bytes Downloaded - all calls
ULBytes AS LONG 'Total Bytes Uploaded - all calls
ULBytes2 AS LONG 'Total Bytes Uploaded - all calls
DeleteFlag AS STRING * 1 'Delete Flag (y or n)
LastMsgArea AS LONG 'Last Read Message Area 0 (Main)
LastReads AS STRING * 156 'This range of bytes contain the last message
Pointer AS INTEGER 'Pointer to FNEXTUSR/FNUSERS.INF/COSYSOP.BIT recs
BirthDate AS INTEGER 'Birthdate crunched into an interger.
Future2 AS STRING * 11 '(- Reserved for future use -)
END TYPE
'
' Spitfire 3.1 user record.
'
TYPE SFUserRecord 'Len = 315
LenUserName AS STRING * 31
LenCallingFrom AS STRING * 31
LenPassword AS STRING * 15
LenTimeDate AS STRING * 15
LenPhoneNumber AS STRING * 13
LenBirthDate AS STRING * 9
SecurityLevel AS INTEGER
Uploads AS LONG
Downloads AS LONG
TotalUK AS LONG
TotalDK AS LONG
TimesOn AS INTEGER
TimeLeft AS INTEGER
LastMConf AS INTEGER
LastFArea AS INTEGER
TransPro AS INTEGER
Defaults AS STRING * 1
LenFirstLogDate AS STRING * 9
SubscriptionDate AS LONG
ConfQueue AS STRING * 32
ExtraBytes AS STRING * 75
AllowPurge AS STRING * 1
BadLastOff AS STRING * 1
ScrollBack AS STRING * 1
Xpert AS STRING * 1
LockedOut AS STRING * 1
Deleted AS STRING * 1
Linelen AS STRING * 1
Pagelen AS STRING * 1
OnToday AS STRING * 1
Illegal AS STRING * 1
DLToday AS STRING * 1
ForeGround AS STRING * 1
ExtraWord AS INTEGER
DLBytes AS LONG
LenNewFCheck AS STRING * 9
OrgSecurity AS INTEGER
ChatsToday AS INTEGER
Extra AS STRING * 21
END TYPE
'
' Renegade 12-25-93 user record.
'
TYPE RGUserRecord 'Len = 1567
LenAlias AS STRING * 37 '/* user name */
LenRealName AS STRING * 37 '/* real name */
LenPassword AS STRING * 21 '/* user password */
LenPhone AS STRING * 13 '/* user phone # */
LenBirthDate AS STRING * 9 '/* user birthdate */
LenFirstCall AS STRING * 9 '/* firston date */
LenLastOn AS STRING * 9 '/* laston date */
LenAddress AS STRING * 31 '/* mailing address */
LenCityState AS STRING * 31 '/* city, state */
LenZipCode AS STRING * 11 '/* zipcode */
LenComputer AS STRING * 36 '/* type of computer */
LenJob AS STRING * 36 '/* occupation */
LenBBSRef AS STRING * 36 '/* BBS reference */
LenSysopNote AS STRING * 36 '/* SysOp note */
LenMenu AS STRING * 9 '/* menu to start user out on */
LenLockOut AS STRING * 9 '/* lockout msg to print */
Toggles AS STRING * 2 '/* flags (see above) */
Attr AS STRING * 3 '/* user flags */
ARFlags AS STRING * 4 '/* AR flags */
VoteData AS STRING * 25 '/* voting data */
Gender AS STRING * 1 '/* user sex */
TotalMins AS LONG '/* total mins spent on */
ULBytesK AS LONG '/* amount ULed (kilobytes) */
DLBytesK AS LONG '/* amount DLed (kilobytes) */
MinsLeft AS INTEGER '/* # min left today */
FwdToUserNum AS INTEGER '/* forward mail to user # */
FilePoints AS INTEGER '/* # of file points */
Uplds AS INTEGER '/* # of ULs */
Dnlds AS INTEGER '/* # of DLs */
Logons AS INTEGER '/* # times logged on */
MsgsPosted AS INTEGER '/* # public posts */
EMsgsPosted AS INTEGER '/* # private posts */
FeedbackSent AS INTEGER '/* # feedback posts */
BankedMins AS INTEGER '/* # mins in Time Bank */
BankedToday AS INTEGER '/* time added to timebank TODAY */
DLKBToday AS INTEGER '{ # kbytes dl today}
FilesToday AS INTEGER '{ # files dl today }
MailWaiting AS STRING * 1 '{ mail waiting }
LineLength AS STRING * 1 '/* line length (# cols) */
PageLength AS STRING * 1 '/* page length (# rows) */
TimesOnToday AS STRING * 1 '/* # times on today */
Attempts AS STRING * 1 '/* # illegal logon attempts */
Barf AS STRING * 1 '
LastMsgBase AS STRING * 1 '/* last message base # */
LastFileBase AS STRING * 1 '/* last file base # */
SecLevel AS STRING * 1 '/* SL */
DSL AS STRING * 1 '/* DSL */
LastRead AS STRING * 1000 '/* NewScan high message pointers */
MBasesTogs AS STRING * 32 '/* NewScan message bases */
FBasesTogs AS STRING * 32 '/* NewScan file bases */
Colors AS STRING * 20 '/* user colors */
Garbage AS STRING * 1
TimeBankWith AS INTEGER '{ amount of time withdrawn today}
PassWordCh AS INTEGER '{ last day password changed }
DefArcType AS STRING * 1 '{ default QWK archive type }
LastConf AS STRING * 1 '{ last conference they were in }
LastQwk AS LONG '{ date/time of last qwk packet }
GetOwnQwk AS STRING * 1 '{ add own messages to qwk packet? }
ScanFilesQwk AS STRING * 1 '{ scan file bases for qwk packets? }
PrivateQwk AS STRING * 1 '{ get private mail in qwk packets? }
Credit AS LONG '{ Amount of credit a user has }
Debit AS LONG '{ Amount of debit a user has }
Expire AS LONG '{ Expiration date of this user }
ExpireSL AS STRING * 1 '{ Subscription level to expire to }
Colors2 AS STRING * 1 '{ User's color scheme # }
TeleConfEcho AS STRING * 1 '{ echo Teleconf lines? }
TeleConfInt AS STRING * 1 '{ interrupt during typing? }
END TYPE
'
' RemoteAccess 1.11 user record.
'
TYPE RAUserRecord 'Len = 158
LenName AS STRING * 36
LenLocation AS STRING * 26
LenPassword AS STRING * 16
LenDataPhone AS STRING * 13
LenVoicePhone AS STRING * 13
LenLastTime AS STRING * 6
LenLastDate AS STRING * 9
Attr AS STRING * 1
Flags AS STRING * 4
Credit AS INTEGER
Pending AS INTEGER
MsgsPosted AS INTEGER
LastRead AS INTEGER
Security AS INTEGER
NoCalls AS INTEGER
Uploads AS INTEGER
Downloads AS INTEGER
UploadsK AS INTEGER
DownloadsK AS INTEGER
TodayK AS INTEGER
Elapsed AS INTEGER
ScreenLength AS INTEGER
LastPwdChange AS STRING * 1
Toggles AS STRING * 1
Group AS STRING * 1
XIrecord AS INTEGER
ExtraSpace AS STRING * 3
END TYPE
'
'
' MessageRecord is the record structure used for each messages header in
' the MESSAGES.HDR file.
'
TYPE MessageRecord 'Len = 136
Attr AS INTEGER '16 bits:
'1 True if a deleted message.
'2 True if Msg body is compressed.
'3 True if this is a reply.
'x True if NetMail
'x True if shouldn't ever NetMail out.
'5 True if shouldn't ever Auto delete.
'x True if should never delete at all.
'8 True if redirected from sysop.
'9 True if redirected from AI.
'10 True if redirected to sysop.
'11 True if redirected to AI.
'12 True if there are file attaches.
'13 True if message will be completed later.
'14 True if any file attaches are free.
'16 True if want's RR (temporary until NetMail)
'Rest are for the future.
MsgNum AS LONG '1 to 2,100,000,000 message number.
'Each message base has it's own message
'counter.
MsgFrom AS STRING * 30 'Name of sender. Mixed case.
MsgTo AS STRING * 30 'Name of receiver or "ALL". Mixed case.
MsgDateSent AS INTEGER 'Date message was sent.
'Date stored in integer form.
MsgTimeSent AS INTEGER 'Time stored in integer form.
'HHMM and +/-'ve depending on am/pm.
MsgDateRcvd AS INTEGER 'Date message was received. 0 if not
'received or sent to "ALL".
'Date stored in integer form.
MsgTimeRcvd AS INTEGER 'Time stored in integer form.
'HHMM and +/-'ve depending on am/pm.
NumOfBytes AS INTEGER 'Doesn't exceed 16384, message length.
NumberReplies AS STRING * 1 'This message has been replied to x times.
'This is not the number of active replies.
TimesRead AS INTEGER 'Number of times this message has been read.
LastDateRead AS INTEGER 'last date anybody read the message.
MsgSubject AS STRING * 33 'Compressed text--message subject.
MsgBase AS INTEGER '0 - 32,767 Message bases.
x AS INTEGER 'not used
Attr2 AS INTEGER 'not used, save for future attr2
SourceAddr AS STRING * 6 'NetMail source address.
DestAddr AS STRING * 6 'NetMail destination address.
MsgLoc AS LONG
END TYPE
'
' FeatherNet Pro 1.01 message header record.
'
TYPE FeNMsgHeaderRec 'Len = 128
Status1 AS STRING * 1 'Status Flag
MsgNum AS INTEGER 'Message Number (1 to 9,999,999)
MsgNum2 AS INTEGER
RefNum AS LONG 'Reference Message Number (1 to 9,999,999)
MsgBlkSize AS STRING * 1 'Number of 128 byte blocks in the message
DateSent AS STRING * 8 'Date of message as (mm-dd-yy)
TimeSent AS STRING * 5 'Time of Message as (hh:mm)
MsgTo AS STRING * 25 'Who the Message is For
ReplyDate AS LONG 'Date of reply message as (yymmdd)
LastReply AS STRING * 5 'Time of last reply message
HasReplies AS STRING * 1 'The letter "R" if an "ALL" msg. has reply(s)
MsgFrom AS STRING * 25 'Who the Message is From
MsgSubject AS STRING * 25 'The Subject of the Message
Password AS STRING * 12 'Password of the Message (Not Used)
Status2 AS STRING * 1 'chr$(225) for active or chr$(226) for inactive
Status3 AS STRING * 1 'The letter "E" if message is to be echoed
Attaches AS INTEGER '(Record in the Conf attach database for file)
Future AS STRING * 4 '(Reserved for future use)
END TYPE
'
' Spitfire 3.1 message header record.
'
TYPE SFMsgHeaderRec 'Len = 256
LenMDate AS STRING * 18
LenFromWho AS STRING * 31
LenToWho AS STRING * 31
LenOrgTo AS STRING * 31
LenSubject AS STRING * 41
NetMail AS STRING * 1
MsgSent AS STRING * 1
PurgeWhenSent AS STRING * 1
ThreadMsg AS STRING * 1
ThreadStart AS STRING * 1
Private AS STRING * 1
Deleted AS STRING * 1
Received AS STRING * 1
Where AS INTEGER
NumberofRecords AS INTEGER
Conference AS INTEGER
MsgNumber AS LONG
OrgMsgNumber AS LONG
Extra AS STRING * 82
END TYPE
'
' Renegade 12-25-93 message header record.
'
TYPE RGMsgHeaderRec 'Len = 326
FAnonFlag AS STRING * 1 '/* anonymous type (0=no, 1/2=yes, 3="Abby", */
FUserRec AS INTEGER '/* user number (0=none) */
FLenHandle AS STRING * 37 '/* user name (all caps) if anon=3..5, */
FLenName AS STRING * 37 '/* user real name (all caps) */
FLenAlias AS STRING * 37 '/* user alias (all caps) */
FZone AS INTEGER '/* zone (0=none) */
FNet AS INTEGER '/* net (0=none) */
FNode AS INTEGER '/* node (0=none) */
FPoint AS INTEGER '/* point (0=none) */
TAnonFlag AS STRING * 1 '/* anonymous type (0=no, 1/2=yes, 3="Abby", */
TUserRec AS INTEGER '/* user number (0=none) */
TLenHandle AS STRING * 37 '/* user name (all caps) if anon=3..5, */
TLenName AS STRING * 37 '/* user real name (all caps) */
TLenAlias AS STRING * 37 '/* user alias (all caps) */
TZone AS INTEGER '/* zone (0=none) */
TNet AS INTEGER '/* net (0=none) */
TNode AS INTEGER '/* node (0=none) */
TPoint AS INTEGER '/* point (0=none) */
TextPtr AS LONG '/* pointer to message text */
MsgLength AS INTEGER '/* length of message text */
ReplyTo AS INTEGER '{ message it's a reply to }
Date AS LONG '{ date/time packed string }
DayOfWeek AS STRING * 1 '{ message day of week }
Status AS STRING * 1 '{ message status flags }
Replies AS INTEGER '{ times replied to }
LenSubject AS STRING * 41 '{ subject of message }
LenOrgDate AS STRING * 20 '{ date of echo/group msgs }
FileAttach AS STRING * 1 '{ 0=No, 1=Yes&Del, 2=Yes&Save }
NetAttr AS INTEGER '{ Netmail attributes }
Res AS STRING * 2 '{ reserved }
END TYPE
'
' RemoteAccess 1.11 message header record.
'
TYPE RAMsgHeaderRec 'Len = 187
MsgNum AS INTEGER
PrevReply AS INTEGER
NextReply AS INTEGER
TimesRead AS INTEGER
StartBlock AS INTEGER
NumBlocks AS INTEGER
DestNet AS INTEGER
DestNode AS INTEGER
OrigNet AS INTEGER
OrigNode AS INTEGER
DestZone AS STRING * 1
OrigZone AS STRING * 1
Cost AS INTEGER
MsgAttr AS STRING * 1
NetAttr AS STRING * 1
Board AS STRING * 1
LenPostTime AS STRING * 6
LenPostDate AS STRING * 9
LenWhoTo AS STRING * 36
LenWhoFrom AS STRING * 36
LenSubject AS STRING * 73
END TYPE
DECLARE FUNCTION Adjust$ (st$)
COMMON SHARED _
User AS UserRecord, _
FeNUser AS FeNUserRecord, _
SFUser AS SFUserRecord, _
RGUser AS RGUserRecord, _
RAUser AS RAUserRecord, _
Message AS MessageRecord, _
FeNMsg AS FeNMsgHeaderRec, _
SFMsg AS SFMsgHeaderRec, _
RGMsg AS RGMsgHeaderRec, _
RAMsg AS RAMsgHeaderRec
'
' Start of actual code.
'
CLS
PRINT
PRINT "This program converts the users and messages of other BBS programs to JDR_BBS"
PRINT "format. The USERS.HDR file is created new, but MESSAGES.HDR is appended onto."
PRINT
PRINT " *All files must be in the current directory.* *Make backups.*"
PRINT
PRINT " FROM TO"
PRINT "* 1. Spitfire 3.1 SFUSERS.DAT JDR_BBS .10 USERS.HDR"
PRINT "* 2. FeatherNet Pro 1.01 USERS JDR_BBS .10 USERS.HDR"
PRINT "* 3. RemoteAccess 1.11 USERS.BBS JDR_BBS .10 USERS.HDR"
PRINT " 4. Renegade 12-25-93 USERS.DAT JDR_BBS .10 USERS.HDR"
PRINT "* 5. Spitfire 3.1 SFMSGxx.PTR/SFMSGxx.DAT JDR_BBS .10 MESSAGES.*"
PRINT "* 6. FeatherNet Pro 1.01 MSGS JDR_BBS .10 MESSAGES.*"
PRINT "* 7. RemoteAccess 1.11 MSGHDR.BBS/MSGTXT.BBS JDR_BBS .10 MESSAGES.*"
PRINT " 8. Renegade 12-25-93 msgarea.HDR/msgarea.DAT JDR_BBS .10 MESSAGES.*"
PRINT "*These have not yet been tested."
PRINT
PRINT "If the conversion doesn't work, or is not to your liking, tell me and I will"
PRINT "fix the problem, and put up a working/better version the next day on my BBS."
PRINT
PRINT "Do which [1..8]";
INPUT K
PRINT
SELECT CASE K
CASE 1 TO 4
PRINT
PRINT "Hit <esc> if things start looking bad, then tell John whats wrong."
PRINT
PRINT "Handle/Alias name Real name"
PRINT "------------------------------ ------------------------------"
CASE 5 TO 8
PRINT
PRINT "Hit <esc> if things start looking bad, then tell John whats wrong."
PRINT
PRINT "From To"
PRINT "------------------------------ ------------------------------"
END SELECT
SELECT CASE K
CASE 1 : CALL SFtoJDR
CASE 2 : CALL FeNtoJDR
CASE 3 : CALL RAtoJDR
CASE 4 : CALL RGtoJDR
CASE 5 : CALL SFMsgToJDR
CASE 6 : CALL FeNMsgToJDR
CASE 7 : PRINT "Working...";
CALL RAMsgToJDR
CASE 8 : CALL RGMsgToJDR
END SELECT
SELECT CASE K
CASE 1 TO 4
PRINT "Done."
PRINT
PRINT "Please delete your INDEXES\USERS.IDX file if it had previously existed."
PRINT "Copy USERS.HDR to GLOBAL\SYSTEM\ for use."
CASE 5 TO 8
PRINT "Done."
PRINT
PRINT "Please delete your INDEXES\MSGS_*.IDX files if they had previously existed."
PRINT "Copy MESSAGES.* to GLOBAL\SYSTEM\ for use."
END SELECT
END
SUB FeNtoJDR
OPEN "USERS" FOR BINARY AS #1
OPEN "USERS.HDR" FOR BINARY AS #2
CALL InitNewUser
FOR K0 = 1 TO LOF(1) \ 400
GET #1,,FeNUser
User.RealName = FeNUser.RealName
User.CityState = FeNUser.CityState
User.Password = FeNUser.Password
User.BBSPhone = FeNUser.BBSPhone
User.HomePhone = FeNUser.HomePhone
User.Protocol = FeNUser.Protocol
User.SecLevel = ASC(FeNUser.SecLevel)
User.Logons = FeNUser.Logons
User.ScreenSize = FeNUser.ScreenSize
User.Uplds = FeNUser.Uplds
User.Dnlds = FeNUser.Dnlds
User.UserName = FeNUser.UserName
User.MsgsPosted = FeNUser.MsgsPosted1
User.DLBytes = FeNUser.DLBytes
User.ULBytes = FeNUser.ULBytes
User.BirthDate = FeNUser.BirthDate
PRINT User.UserName;" ";User.RealName
PUT #2,,User
IF INKEY$ = CHR$(27) THEN EXIT FOR
NEXT
CLOSE 1, 2
END SUB
SUB SFtoJDR
OPEN "SFUSERS.DAT" FOR BINARY AS #1
OPEN "USERS.HDR" FOR BINARY AS #2
CALL InitNewUser
FOR K0 = 1 TO LOF(1) \ 315
GET #1,,SFUser
User.UserName = Adjust$(SFUser.LenUserName)
User.Password = Adjust$(SFUser.LenPassword)
User.CityState = Adjust$(SFUser.LenCallingFrom)
User.SecLevel = SFUser.SecurityLevel
User.Logons = SFUser.TimesOn
User.Dnlds = SFUser.Downloads
User.DLBytes = SFUser.TotalDK * 1024&
User.Uplds = SFUser.Uploads
User.ULBytes = SFUser.TotalUK * 1024&
PRINT User.UserName;" ";User.RealName
PUT #2,,User
IF INKEY$ = CHR$(27) THEN EXIT FOR
NEXT
CLOSE 1, 2
END SUB
SUB RGtoJDR
OPEN "USERS.DAT" FOR BINARY AS #1
OPEN "USERS.HDR" FOR BINARY AS #2
CALL InitNewUser
GET #1,,RGUser 'Skip past empty first record.
FOR K0 = 2 TO LOF(1) \ 1567
GET #1,,RGUser
User.UserName = Adjust$(RGUser.LenAlias) 'Uppercase.
User.RealName = Adjust$(RGUser.LenRealName) 'Mixed case.
IF UCASE$(User.RealName) = User.UserName _
THEN User.UserName = User.RealName
User.Password = Adjust$(RGUser.LenPassword)
User.CityState = Adjust$(RGUser.LenCityState)
User.SecLevel = ASC(RGUser.SecLevel)
User.Logons = RGUser.Logons
User.MsgsPosted = RGUser.MsgsPosted
User.EMsgsPosted = RGUser.EMsgsPosted
User.FMsgsPosted = RGUser.FeedbackSent
User.Dnlds = RGUser.Dnlds
User.DLBytes = RGUser.DLBytesK * 1024&
User.Uplds = RGUser.Uplds
User.ULBytes = RGUser.ULBytesK * 1024&
User.HomePhone = Adjust$(RGUser.LenPhone)
User.ScreenSize = RGUser.PageLength
PRINT User.UserName;" ";User.RealName
PUT #2,,User
IF INKEY$ = CHR$(27) THEN EXIT FOR
NEXT
CLOSE 1, 2
END SUB
SUB RAtoJDR
OPEN "USERS.BBS" FOR BINARY AS #1
OPEN "USERS.HDR" FOR BINARY AS #2
CALL InitNewUser
FOR K0 = 1 TO LOF(1) \ 158
GET #1,,RAUser
User.UserName = Adjust$(RAUser.LenName)
User.Password = Adjust$(RAUser.LenPassword)
User.CityState = Adjust$(RAUser.LenLocation)
User.SecLevel = RAUser.Security
User.Logons = RAUser.NoCalls
User.Dnlds = RAUser.Downloads
User.DLBytes = RAUser.DownloadsK * 1024&
User.Uplds = RAUser.Uploads
User.ULBytes = RAUser.UploadsK * 1024&
User.MinCredits = RAUser.Credit
User.MsgsPosted = RAUser.MsgsPosted
PRINT User.UserName;" ";User.RealName
PUT #2,,User
IF INKEY$ = CHR$(27) THEN EXIT FOR
NEXT
CLOSE 1, 2
END SUB
SUB FeNMsgToJDR
INPUT "Full path\filename to use (a MSGS file): ";K$
IF K$ = "" THEN EXIT SUB
INPUT "Message base number to use (1..n): ";K0
OPEN K$ FOR BINARY AS #1
OPEN "MESSAGES.HDR" FOR BINARY AS #3
OPEN "MESSAGES.BDY" FOR BINARY AS #4
CALL InitMsg
SEEK #3,LOF(3) + 1
SEEK #4,LOF(4) + 1
K& = 0
K$ = SPACE$(128)
GET #1,,K$ 'Past conference info.
DO
GET #1,,FeNMsg
Message.MsgNum = FeNMsg.MsgNum
Message.MsgFrom = FeNMsg.MsgFrom
Message.MsgTo = FeNMsg.MsgTo
Message.MsgSubject = FeNMsg.MsgSubject
Message.MsgBase = K0
MessageBody$ = ""
FOR K = 1 TO ASC(FeNMsg.MsgBlkSize)
GET #1,,K$
MessageBody$ = LEFT$(MessageBody$ + K$,16384)
NEXT
CALL ConvertChars(MessageBody$)
Message.NumOfBytes = LEN(MessageBody$)
Message.MsgLoc = K&
PUT #3,,Message
PUT #4,,MessageBody$
K& = K& + Message.NumOfBytes
PRINT Message.MsgFrom;" ";Message.MsgTo
IF INKEY$ = CHR$(27) THEN EXIT DO
LOOP UNTIL EOF(1)
CLOSE 1, 3, 4
END SUB
SUB SFMsgToJDR
INPUT "Full path\filename to use [no extension] (a .PTR file): ";K$
IF K$ = "" THEN EXIT SUB
OPEN K$ + "PTR" FOR BINARY AS #1
OPEN K$ + "DAT" FOR BINARY AS #2
OPEN "MESSAGES.HDR" FOR BINARY AS #3
OPEN "MESSAGES.BDY" FOR BINARY AS #4
CALL InitMsg
SEEK #3,LOF(3) + 1
SEEK #4,LOF(4) + 1
K& = 0
DO
GET #1,,SFMsg
Message.MsgNum = SFMsg.MsgNumber
Message.MsgFrom = Adjust$(SFMsg.LenFromWho)
Message.MsgTo = Adjust$(SFMsg.LenToWho)
Message.MsgSubject = Adjust$(SFMsg.LenSubject)
Message.MsgBase = SFMsg.Conference
MessageBody$ = ""
K$ = SPACE$(128)
FOR K = SFMsg.Where TO SFMsg.Where + SFMsg.NumberofRecords - 1
K0& = (K - 1) * 128& + 1
GET #2,K0&,K$
MessageBody$ = LEFT$(MessageBody$ + Adjust$(K$),16384)
NEXT
CALL ConvertChars(MessageBody$)
Message.NumOfBytes = LEN(MessageBody$)
Message.MsgLoc = K&
PUT #3,,Message
PUT #4,,MessageBody$
K& = K& + Message.NumOfBytes
PRINT Message.MsgFrom;" ";Message.MsgTo
IF INKEY$ = CHR$(27) THEN EXIT DO
LOOP UNTIL EOF(1)
CLOSE 1, 2, 3, 4
END SUB
SUB RGMsgToJDR
PRINT "path\filename to import (a .HDR & .DAT file--no extension)"
INPUT ": ";K$
IF K$ = "" THEN EXIT SUB
INPUT "Message base number to use (1..n): ";K0
OPEN K$ + ".HDR" FOR BINARY AS #1
OPEN K$ + ".DAT" FOR BINARY AS #2
OPEN "MESSAGES.HDR" FOR BINARY AS #3
OPEN "MESSAGES.BDY" FOR BINARY AS #4
CALL InitMsg
SEEK #3,LOF(3) + 1
SEEK #4,LOF(4) + 1
K& = 0
K = 0
FOR K1 = 1 TO LOF(1) \ 326
GET #1,,RGMsg
K = K + 1
Message.MsgNum = K
Message.MsgFrom = Adjust$(RGMsg.FLenName)
Message.MsgTo = Adjust$(RGMsg.TLenName)
Message.MsgSubject = Adjust$(RGMsg.LenSubject)
Message.MsgBase = K0
Message.SourceAddr = MKI$(RGMsg.FZone) + MKI$(RGMsg.FNet) + MKI$(RGMsg.FNode)
IF Message.SourceAddr = STRING$(6,0) THEN Message.SourceAddr = SPACE$(6)
Message.DestAddr = MKI$(RGMsg.TZone) + MKI$(RGMsg.TNet) + MKI$(RGMsg.TNode)
IF Message.DestAddr = STRING$(6,0) THEN Message.DestAddr = SPACE$(6)
IF RGMsg.MsgLength < 1 THEN RGMsg.MsgLength = 1
MessageBody$ = SPACE$(RGMsg.MsgLength - 1)
GET #2,RgMsg.TextPtr + 1,MessageBody$
MessageBody$ = LEFT$(MessageBody$,16384)
CALL ConvertChars(MessageBody$)
Message.NumOfBytes = LEN(MessageBody$)
Message.MsgLoc = K&
PUT #3,,Message
PUT #4,,MessageBody$
K& = K& + Message.NumOfBytes
PRINT Message.MsgFrom;" ";Message.MsgTo
IF INKEY$ = CHR$(27) THEN EXIT FOR
NEXT
CLOSE 1, 2, 3, 4
END SUB
SUB RAMsgToJDR
OPEN "MSGHDR.BBS" FOR BINARY AS #1
OPEN "MSGTXT.BBS" FOR BINARY AS #2
OPEN "MESSAGES.HDR" FOR BINARY AS #3
OPEN "MESSAGES.BDY" FOR BINARY AS #4
CALL InitMsg
SEEK #3,LOF(3) + 1
SEEK #4,LOF(4) + 1
K& = 0
DO
GET #1,,RAMsg
Message.MsgNum = RAMsg.MsgNum
Message.MsgFrom = Adjust$(RAMsg.LenWhoFrom)
Message.MsgTo = Adjust$(RAMsg.LenWhoTo)
Message.TimesRead = RAMsg.TimesRead
Message.MsgSubject = Adjust$(RAMsg.LenSubject)
Message.MsgBase = ASC(RAMsg.Board) - 1
IF Message.MsgBase < 0 THEN Message.MsgBase = 0
Message.SourceAddr = MKI$(ASC(RAMsg.OrigZone)) + MKI$(RAMsg.OrigNet) + MKI$(RAMsg.OrigNode)
IF Message.SourceAddr = STRING$(6,0) THEN Message.SourceAddr = SPACE$(6)
Message.DestAddr = MKI$(ASC(RAMsg.DestZone)) + MKI$(RAMsg.DestNet) + MKI$(RAMsg.DestNode)
IF Message.DestAddr = STRING$(6,0) THEN Message.DestAddr = SPACE$(6)
MessageBody$ = ""
K$ = SPACE$(256)
FOR K = RAMsg.StartBlock TO RAMsg.StartBlock + RAMsg.NumBlocks - 1
K0& = K * 256& + 1
GET #2,K0&,K$
MessageBody$ = LEFT$(MessageBody$ + Adjust$(K$),16384)
NEXT
CALL ConvertChars(MessageBody$)
Message.NumOfBytes = LEN(MessageBody$)
Message.MsgLoc = K&
PUT #3,,Message
PUT #4,,MessageBody$
K& = K& + Message.NumOfBytes
PRINT Message.MsgFrom;" ";Message.MsgTo
IF INKEY$ = CHR$(27) THEN EXIT DO
LOOP UNTIL EOF(1)
CLOSE 1, 2, 3, 4
END SUB
SUB InitMsg
Message.Attr = 0
Message.MsgNum = 0
Message.MsgFrom = ""
Message.MsgTo = ""
Message.MsgDateSent = 0
Message.MsgTimeSent = 0
Message.MsgDateRcvd = 0
Message.MsgTimeRcvd = 0
Message.NumOfBytes = 0
Message.NumberReplies = CHR$(0)
Message.TimesRead = 0
Message.LastDateRead = 0
Message.MsgSubject = ""
Message.MsgBase = 0
Message.Attr2 = 0
Message.SourceAddr = SPACE$(6)
Message.DestAddr = SPACE$(6)
Message.MsgLoc = 0
END SUB
SUB InitNewUser
User.UserName = "#NEWUSER"
User.Password = ""
User.CityState = ""
User.SysopNote = -1
User.UserNote = -1
User.BirthDate = 0
User.SecLevel = 5
User.FirstCall = 0
User.Attr = 0
User.Toggles = - (2 + 16 + 32 + 2048 + 4096 + 8192)
User.Protocol = "Z"
User.Votes = STRING$(100,0)
User.SubsStart = 0
User.Style = ""
User.Language = ""
User.ElapsedMinsC = 0
User.ElapsedMins = 0
User.LastCallerNum = 0
User.LastDateOn = 0
User.PswdChange = CHR$(0)
User.AlterDate = 0
User.Toggles2 = 2
User.PRStuff = STRING$(8,0)
User.Connect = CHR$(0)
User.NewFilesPtr = 0
User.HighestPtr = 0
User.PagedSysop = 0
User.Logons = 0
User.Attempts = CHR$(0)
User.MinCredits = 0
User.MinMegs = 0
User.MsgsPosted = 0
User.EMsgsPosted = 0
User.FMsgsPosted = 0
User.NetMailSent = 0
User.NetMailRcvd = 0
User.Elapsed = 0
User.Dnlds = 0
User.DLBytes = 0
User.MinsDLing = 0
User.BadDLs = 0
User.Uplds = 0
User.ULBytes = 0
User.MinsULing = 0
User.BadULs = 0
User.Doors = 0
User.SubsEnd = 0
User.HighNotePtr = -1
User.TotalMonies = 0
User.LastMonies = 0
User.Attr2 = 0
User.BytesUToday = 0
User.BytesUWeek = 0
User.MsgsRcvd = 0
User.EMsgsRcvd = 0
User.SLSubsEnds = 0
User.ScreenSize = CHR$(0)
User.MsgRC = "
"
User.RealName = "#NEWUSER"
User.HomePhone = ""
User.BBSPhone = ""
PUT #2,1,User
END SUB
FUNCTION Adjust$ (K$)
Adjust$ = MID$(K$,2,ASC(K$))
END FUNCTION
SUB ConvertChars (K$)
FOR K = 1 TO LEN(K$)
SELECT CASE ASC(MID$(K$,K,1))
CASE 9 : MID$(K$,K,1) = " "
CASE 29 : MID$(K$,K,1) = "-"
END SELECT
NEXT
END SUB
'
' to compile: BC CONVERT.BAS /O/S/FS;
' to link : LINK /EXEPACK /PACKCODE CONVERT;
' requires : BC.EXE, LINK.EXE, BCL70EFR.LIB, BRT70EFR.LIB
' (Basic PDS 7.0+, although it should compile with other Basic's).
'